package com.bdqn.crm.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * @TableName orders_line
 */
@TableName(value = "orders_line")
@Data
public class OrdersLine implements Serializable {
    /**
     * 明细编号
     */
    @TableId(type = IdType.AUTO)
    private Long oddId;

    /**
     * 订单编号
     */
    private Long oddOrderId;

    /**
     * 商品编号
     */
    private Long oddProdId;

    /**
     * 数量
     */
    private Integer oddCount;

    /**
     * 单位
     */
    private String oddUnit;

    /**
     * 价格
     */
    private BigDecimal oddPrice;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        OrdersLine other = (OrdersLine) that;
        return (this.getOddId() == null ? other.getOddId() == null : this.getOddId().equals(other.getOddId()))
                && (this.getOddOrderId() == null ? other.getOddOrderId() == null : this.getOddOrderId().equals(other.getOddOrderId()))
                && (this.getOddProdId() == null ? other.getOddProdId() == null : this.getOddProdId().equals(other.getOddProdId()))
                && (this.getOddCount() == null ? other.getOddCount() == null : this.getOddCount().equals(other.getOddCount()))
                && (this.getOddUnit() == null ? other.getOddUnit() == null : this.getOddUnit().equals(other.getOddUnit()))
                && (this.getOddPrice() == null ? other.getOddPrice() == null : this.getOddPrice().equals(other.getOddPrice()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getOddId() == null) ? 0 : getOddId().hashCode());
        result = prime * result + ((getOddOrderId() == null) ? 0 : getOddOrderId().hashCode());
        result = prime * result + ((getOddProdId() == null) ? 0 : getOddProdId().hashCode());
        result = prime * result + ((getOddCount() == null) ? 0 : getOddCount().hashCode());
        result = prime * result + ((getOddUnit() == null) ? 0 : getOddUnit().hashCode());
        result = prime * result + ((getOddPrice() == null) ? 0 : getOddPrice().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", oddId=").append(oddId);
        sb.append(", oddOrderId=").append(oddOrderId);
        sb.append(", oddProdId=").append(oddProdId);
        sb.append(", oddCount=").append(oddCount);
        sb.append(", oddUnit=").append(oddUnit);
        sb.append(", oddPrice=").append(oddPrice);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}